package com.example.api.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Create with Intellij idea
 * User: mingtian
 * Date:2018/11/20
 * Time:23:25
 */
@RestController
@RefreshScope       //修改配置文件过后，自动刷新
public class TestController {

    //@Value("${name}")
    private String name;  //配置文件中设置的属性


    @Value("${content}")
    private String content;

    @RequestMapping("/getContent")
    public String getContent(){
        return content;
    }

    @RequestMapping("/getName")
    public String getName(){
        return name;
    }
}
